package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity{
    TextView team,score;
    Button b1,b2,b3,re;
    private static final String TAG = "MainActivity";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.liuhr);
        team = findViewById(R.id.tm);
        score = findViewById(R.id.sc);
        b1=(Button)findViewById(R.id.b1);
        b1.setOnClickListener(this::Clickb1);
        b2=(Button)findViewById(R.id.b2);
        b2.setOnClickListener(this::Clickb2);
        b3=(Button)findViewById(R.id.b3);
        b3.setOnClickListener(this::Clickb3);
        re=(Button)findViewById(R.id.re);
        re.setOnClickListener(this::Clickre);
        int sum=0;
    }
    int sum;
    public void Clickb1(View v){
        Log.i(TAG,"myClick:11111");
        Log.i(TAG,"myClick");
        sum=sum+1;
        score.setText(""+sum);


    }
    public void Clickb2(View v){
        Log.i(TAG,"myClick:11111");
        Log.i(TAG,"myClick");
        sum=sum+2;
        score.setText(""+sum);

    }
    public void Clickb3(View v){
        Log.i(TAG,"myClick:11111");
        Log.i(TAG,"myClick");
        sum=sum+3;
        score.setText(""+sum);

    }
    public void Clickre(View v){
        Log.i(TAG,"myClick:11111");
        Log.i(TAG,"myClick");
        sum=0;
        score.setText(""+sum);

    }





}